package com.gxuwz.leaveSystem.service;

import com.gxuwz.leaveSystem.dao.InstructorDao;
import com.gxuwz.leaveSystem.entity.Department;
import com.gxuwz.leaveSystem.entity.Instructor;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class InstructorService {

    private InstructorDao instructorDao;
    public void setInstructorDao(InstructorDao instructorDao) {
        this.instructorDao = instructorDao;
    }

    /**
     * 添加
     * @param ins
     * @return
     */
    public int add(Instructor ins){
        return instructorDao.add(ins);
    }

    /**
     * 删除
     * @param id
     * @return
     */
    public int delete(String id){
        return instructorDao.delete(id);
    }

    /**
     * 修改
     * @param ins
     * @return
     */

    public int update(Instructor ins){
        return instructorDao.update(ins);
    }

    /**
     * 根据id查列表
     * @param id
     * @return
     */

    public Instructor findByid(String id){
        return instructorDao.findByid(id);
    }

    /**
     * 查询全部
     * @return
     */
    public List<Instructor> findAll(){
        return instructorDao.findAll();
    }

    /**
     * 根据关键字搜索
     * @param keyword
     * @return
     */
    public List<Instructor> search(String keyword) {
        return instructorDao.search(keyword);
    }

}
